package com.kfgj.hkp.manager;

import com.kfgj.hkp.common.BaseEntity;
import com.kfgj.hkp.common.dataaccess.PageResult;

import java.util.List;
import java.util.Map;

/**
 * @description TODO
 * @auth liwensihan
 * @date 2018/7/4 09:17
 * @version 1.0
 * @return
 */
public interface IManager<T extends BaseEntity> {

    /**
     * 通过某个唯一属性查询数据
     * @param prop
     * @param value
     * @return
     */
    public T findOne(String prop, Object value);

    /**
     * 通过多个参数查询唯一数据
     * @param param
     * @return
     */
    public T findOne(Map<String, Object> param);

    public List<T> findByMap(Map<String, Object> param);

    public List<T> findByMap(Map<String, Object> param, String orderBy, boolean isAsc);

    public PageResult<T> findByMap(Map<String, Object> param, int start, int pageSize);

    public PageResult<T> findByMap(Map<String, Object> param, int start, int pageSize, String orderBy, boolean isAsc);

    public int create(T t);

    public int update(T t);


}
